<% provide(:title, "用户管理界面") %>

<table class="table">
  <thead>
  <tr>
    <th>序号</th>
    <th>标题名</th>
    <th colspan="2"></th>
  </tr>
  </thead>

  <tbody>
  <% cache @articles do %>
    <% @articles.each do |article| %>
      <% cache article do %>
        <tr>
          <td><%= article.id %></td>
          <td><%= article.title %></td>
          <td><%= button_to '修改', edit_article_path(id: article.id), method: :get,
                            class: "btn btn-primary" %></td>
          <td><%= button_to '删除', article, method: :delete, data: {confirm: "你确定?"},
                            class: "btn btn-danger" %></td>
        </tr>
      <% end %>
    <% end %>
  <% end %>
  </tbody>
</table>

<div class="digg_pagination">
  <%= will_paginate @articles, :container => false %>
</div>
